<template>
	<div class="page3">
		<h1>page333 .....</h1>

		  <el-button type="primary" round @click="testStore">add_tabs</el-button>
		  <el-button type="success" round @click="clearStore">成功按钮</el-button>
		  
	</div>
</template>


<script type="text/javascript">
import { mapMutations } from 'vuex'

	export default{
		data(){
			return {}
		},
		methods: {
			testStore(){
				this.$store.commit('add_tabs', {route: '/hr' , name: 'tab only'})
				//alert(JSON.stringify(this.$store.state.options))
			},
			clearStore(){
				this.add('from page3\'s add')
				this.add('from page3\'s this.testMap')
				//alert(JSON.stringify(this.$store.getters.doneTodos))
				this.$store.commit('clear_tabs')
			},
			...mapMutations({
		      add: 'testMap' // 将 `this.add()` 映射为 `this.$store.commit('increment')`
		    }),
		    ...mapMutations([
		    	'testMap'
		    ])
		}
	}
</script>